Skip to content

Conversation

lposen
Copy link
Contributor

@lposen lposen commented Sep 30, 2025

🔹 JIRA Ticket(s) if any

✏️ Description

Improved test coverage of Iterable.ts

Copy link

github-actions bot commented Sep 30, 2025

Lines Statements Branches Functions
Coverage: 45%
45.24% (214/473) 20.67% (37/179) 37.41% (58/155)

Copy link

qltysh bot commented Sep 30, 2025

Diff Coverage: The code coverage on the diff in this pull request is 50.0%.

Total Coverage: This PR will increase coverage by 6.66%.

File Coverage Changes
Path File Coverage Δ Indirect
src/core/classes/Iterable.ts 21.7
src/core/classes/IterableAuthResponse.ts 100.0
src/inApp/classes/IterableInAppMessage.ts 12.1
🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

This is from Qlty Cloud, the successor to Code Climate Quality. Learn more.

Copy link

qltysh bot commented Sep 30, 2025

All good ✅
This is from Qlty Cloud, the successor to Code Climate Quality. Learn more.

@lposen lposen requested a review from Copilot October 6, 2025 21:16
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves test coverage for the Iterable.ts file by relocating comprehensive test files and updating package dependencies. The changes aim to enhance code quality and maintainability of the Iterable React Native SDK.

  • Relocates test file from src/__tests__/Iterable.test.ts to src/core/classes/Iterable.test.ts with significant expansion of test cases
  • Updates package dependencies including React Navigation, Testing Library, and various React Native packages
  • Adds timeout handling improvements to prevent process hanging in production code

Reviewed Changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/core/classes/Iterable.test.ts New comprehensive test file with 915 lines covering all major Iterable functionality
src/__tests__/Iterable.test.ts Original test file removed (433 lines deleted)
src/core/classes/Iterable.ts Added unref() calls to timeouts to prevent process hanging
src/__mocks__/MockRNIterableAPI.ts Enhanced mock with additional methods and resolved promises
package.json Updated dependencies and added test watch script
tsdoc.json Simplified configuration by removing TypeDoc plugin extensions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +954 to +955
// Use unref() to prevent the timeout from keeping the process alive
timeoutId.unref();
Copy link
Preview

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unref() method is a Node.js-specific API that doesn't exist in React Native environments. This will cause a runtime error when the code runs on mobile devices.

Suggested change
// Use unref() to prevent the timeout from keeping the process alive
timeoutId.unref();
// In Node.js, you might use timeoutId.unref() to prevent the timeout from keeping the process alive.
// In React Native, unref() is not available and not needed.

Copilot uses AI. Check for mistakes.

Comment on lines +1019 to +1020
// Use unref() to prevent the timeout from keeping the process alive
timeoutId.unref();
Copy link
Preview

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unref() method is a Node.js-specific API that doesn't exist in React Native environments. This will cause a runtime error when the code runs on mobile devices.

Suggested change
// Use unref() to prevent the timeout from keeping the process alive
timeoutId.unref();
// In React Native, unref() is not available and not needed

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant